/*
 * CalendarTest.java
 *
 * Created on November 9, 2006, 1:08 PM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package edu.umn.cs5115.scheduler.calendar;

import edu.umn.cs5115.scheduler.SchedulerDocument;
import edu.umn.cs5115.scheduler.framework.Document;
import edu.umn.cs5115.scheduler.framework.DocumentController;
import edu.umn.cs5115.scheduler.framework.WindowController;

import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;

/**
 * Just displays a window with the calendar in it.
 * @author grant
 */
public class CalendarTest
{
    public static void main(String[] args)
    {
        DocumentController.getSharedDocumentController().setDocumentFactory(new DocumentController.DocumentFactory()
        {
            public Document createDocument()
            {
                return new CalendarDocument();
            }
        });
        DocumentController.getSharedDocumentController().run();
    }
    
    private static class CalendarDocument extends SchedulerDocument
    {
        protected void createWindowControllers()
        {
            Shell shell = new Shell(DocumentController.getSharedDocumentController().getDisplay());
            shell.setLayout(new FillLayout());
            Calendar calendarComposite = new Calendar(shell, this);
            WindowController controller = new WindowController(this, shell);
            controller.showWindow();
        }
    }
}
